from microbit import *
class TK(object):
    def setPin(self, R):
        if R == 'J1':
            self.L = pin1
            self.R = pin8
        if R == 'J2':
            self.L = pin2
            self.R = pin12
        if R == 'J3':
            self.L = pin13
            self.R = pin14
        if R == 'J4':
             self.L = pin15
             self.R = pin16

    def get_state(self, RJPin):
        self.setPin(RJPin)
        l = self.L.read_digital()
        r = self.R.read_digital()
        if l == 1 and r == 1:
            return '00'
        if l == 0 and r == 1:
            return '10'
        if l == 1 and r == 0:
            return '01'
        if l == 0 and r == 0:
            return '11'

tracking = TK()